package Part6_动态性;

/**
 * ClassName: Person
 * Package: IntelliJ IDEA
 * Description:
 * Written by HanXu
 * Create 2024.04.28 0:17
 */
public class Person {
    private String name;
    public int age;

    public Person() {
    }

    public Person(int age) {
        this.age = age;
    }

    private Person(int age, String name) {
        this.age = age;
        this.name = name;
    }

    public void showAge() {
        System.out.println("age = " + this.age);
    }
    private String showName(String name){
        return "Name is " + name;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
